[java] Removing old stream collectors required by Java 8#15523
Merged
diemol merged 3 commits intoSeleniumHQ:trunkfrom Jul 5, 2025
Merged
[java] Removing old stream collectors required by Java 8#15523diemol merged 3 commits intoSeleniumHQ:trunkfrom
diemol merged 3 commits intoSeleniumHQ:trunkfrom
Conversation
Contributor
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Contributor
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
diemol
approved these changes
Jul 5, 2025
This was referenced Sep 12, 2025
This was referenced Sep 19, 2025
This was referenced Oct 1, 2025
This was referenced Oct 20, 2025
This was referenced Dec 15, 2025
This was referenced Jan 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Motivation and Context
There was some left-over
Collectorlogic that was required in Java 8 to create an unmodifiableMap/Set. Since the minimum Java version has been upgraded to Java 11, we can replace these calls withCollectors#toUnmodifiableMap()andCollectors#toUnmodifiableSet()in the standard library (available since Java 10).Types of changes
Checklist
bazel test //java/... --test_size_filters=small)PR Type
Enhancement
Description
Replaced custom collectors with standard Java 10 collectors.
Removed redundant methods for unmodifiable collections.
Simplified stream operations using
Collectors.toUnmodifiableMapandCollectors.toUnmodifiableSet.Changes walkthrough 📝
PersistentCapabilities.java
Refactored to use Java 10 collectors for unmodifiable collectionsjava/src/org/openqa/selenium/PersistentCapabilities.java
toUnmodifiableMapwithCollectors.toUnmodifiableMap.toUnmodifiableSetwithCollectors.toUnmodifiableSet.